package com.wyb.controller.goods;


import com.wyb.entity.Goods;
import com.wyb.service.impl.GoodsServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

@WebServlet("/goods/updateStatus")
public class UpdateGoodsStatusServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
      req.setCharacterEncoding("utf-8");
      resp.setCharacterEncoding("utf-8");
        int goodsId= Integer.parseInt(req.getParameter("goodsId"));
        int status = Integer.parseInt(req.getParameter("status"));
        PrintWriter pw = resp.getWriter();
        boolean b=new GoodsServiceImpl().updateGoodsStatus(status,goodsId);
        pw.println(b);
        pw.flush();


    }
}
